home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / modelers / geomview / next.lha / Geomview.pkg / Geomview.pre_install < prev    next >
Text File  |  1993-11-24  |  1KB  |  43 lines

  1. #! /bin/sh
  2. # Handle the mischance that we're extracting onto a System-V style NFS
  3. # file server.  It will allow the installer's tar to chown all files and
  4. # directories to their original owners, and then be unable to extract them.
  5.  
  6. PATH=$PATH:/bin:/usr/bin:/usr/ucb:/etc; export PATH
  7.  
  8. # Repair any damage from previous runs of this pre_install script
  9. if [ -f $1/Geomview.tar.Z.hide ]; then
  10.     mv $1/Geomview.tar.Z.hide $1/Geomview.tar.Z
  11. fi
  12.  
  13. DIR=$2/Geomview.app
  14. TESTFILE=${DIR}/testfile.$$
  15. mkdir ${DIR} 2>&-
  16. touch ${TESTFILE} 2>&-
  17. chmod 644 ${TESTFILE}
  18.  
  19. # Can we give away the test file, and if so are we unable to write to it?
  20.  
  21. if /etc/chown 3579 ${TESTFILE} 2>&- && test ! -w ${TESTFILE}; then
  22.     rm -f ${TESTFILE}
  23.     echo >&2 "\
  24. You seem to be using a System-V style NFS file server.
  25. The NeXT Installer can't properly extract packages in this environment,
  26. so I'll extract them separately.  The STOP button will be ineffective.
  27. arg 1=$1, arg 2=$2, PATH=$PATH"
  28.  
  29.     # Extract the files using gnu tar...
  30.     (cd $2; $1/gnutar -x -v -p -Z -f $1/Geomview.tar.Z )
  31.  
  32.     # Hide the Geomview.tar.Z file so the Installer won't try to do likewise...
  33.     #  & create an empty Geomview.tar.Z for the Installer to unpack harmlessly.
  34.     mv $1/Geomview.tar.Z $1/Geomview.tar.Z.hide &&
  35.     compress </dev/null >$1/Geomview.tar.Z || :
  36.  
  37.     # Compressing /dev/null gives nonzero exit status; don't kill the install.
  38.  
  39.     exit 0
  40. else
  41.     rm -f ${TESTFILE}
  42. fi
  43.